﻿using Idte.Common.ArtifactModel;
using Idte.Common.Process;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;

namespace Idte.Application.Core.Context
{
    public class WebContext : IExecutionContext
    {
        private Artifact _contextData;
        public WebContext(Controller controller)
        {
            this.Data.Value = controller;
        }

        public string Action { get; set; }
        public IExecutionContext Execute()
        {
            return this;
        }

        public Artifact Data
        {
            get
            {
                if (_contextData == null)
                {
                    _contextData = new Artifact();
                }
                return _contextData;
            }
            set { _contextData = value; }
        }
    }
}
